<?php

class User_admin_model extends Model
{
	function __construct()
	{
		parent::Model();
	}
	
	function User_admin_model()
	{
		self::__construct();
	}
	
	function list_users()
	{
		$this->db->order_by('username', 'asc');
		$this->db->from('users');
		$query = $this->db->get();
		return $query->result_array();
	} // list_users()
	
	function num_users()
	{
		$this->db->from('users');
		$query = $this->db->get();
		return $query->num_rows();
	} // num_users()
	
	function get_group($id)
	{
		$this->db->where('id', $id);
		$this->db->from('groups');
		$query2 = $this->db->get();
		return $query2->row_array();
	} // get_group()
	
	function list_groups()
	{
		$this->db->from('groups');
		$query2 = $this->db->get();
		
		return $query2->result_array();
	} // list_groups()
	
	function get_user()
	{
		$id = $this->uri->segment('4');
		
		$this->db->where('id', $id);
		$query = $this->db->get('users');
		
		return $query->row_array();
	}
	
} // user_admin_model()

/* End of file user_admin_model.php */
/* Location: modules/user/models/user_admin_model.php */